import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_item_acknowledgement_status.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_item_info.dart';
import 'package:equatable/equatable.dart';

class GooglePlayOneTimePurchasedItemInfo extends Equatable implements GooglePlayPurchasedItemInfo {
  const GooglePlayOneTimePurchasedItemInfo({
    required this.purchaseItemSku,
    required this.purchaseToken,
    required this.googlePlayUserId,
    required this.test,
    required this.acknowledgementStatus,
  });

  @override
  final String purchaseToken;

  @override
  final String purchaseItemSku;

  @override
  final String googlePlayUserId;

  @override
  final bool test;

  @override
  final GooglePlayPurchasedItemAcknowledgementStatus acknowledgementStatus;

  @override
  List<Object?> get props {
    return [
      purchaseItemSku,
      purchaseToken,
      googlePlayUserId,
      test,
      acknowledgementStatus,
    ];
  }

  GooglePlayOneTimePurchasedItemInfo copyWith({
    String Function()? purchaseItemSku,
    String Function()? purchaseToken,
    String Function()? googlePlayUserId,
    bool Function()? test,
    GooglePlayPurchasedItemAcknowledgementStatus Function()? acknowledgementStatus,
  }) {
    return GooglePlayOneTimePurchasedItemInfo(
      purchaseItemSku: purchaseItemSku == null ? this.purchaseItemSku : purchaseItemSku(),
      purchaseToken: purchaseToken == null ? this.purchaseToken : purchaseToken(),
      googlePlayUserId: googlePlayUserId == null ? this.googlePlayUserId : googlePlayUserId(),
      test: test == null ? this.test : test(),
      acknowledgementStatus:
          acknowledgementStatus == null ? this.acknowledgementStatus : acknowledgementStatus(),
    );
  }
}
